import { $get, $post, $put } from '@js/request';
import { VideoCourtSchema } from '@src/components/schema/videoCourt';

export async function getListRequest (data: { [k: string]: any }): Promise<{ list: VideoCourtSchema[], total: number }> {
  const res = await $get('/api/commission/meeting', data)
  return res.data
}

export async function delRequest (id: string): Promise<void> {
  const res = await $put(`/api/commission/meeting/cancel/${id}`)
  return res.data
}

export async function updateRequest (d: { [k: string]: any }): Promise<void> {
  const id = d.id
  const res = await $put(`/api/commission/meeting/${id}`, d)
  return res.data
}

export async function addRequest (d: { [k: string]: any }): Promise<void> {
  const res = await $post('/api/commission/meeting', d)
  return res.data
}